package com.fjwt.gz.core.third.interfaces;

import com.alibaba.fastjson2.JSONObject;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialFileBatchGetResult;
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNewsBatchGetResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 公众号管理
 */
public interface IOfficialService {

    /**
     * 同步用户信息
     */
    public int syncFansUserInfo(Long fansId, String openid, Long userId, Long fansUserOpenId);

    /**
     * 上传临时性素材
     */
    public String uploadPicToGzh(String appid, String imgUrl, MultipartFile file, String type, WxMpService wxService);

    /**
     * 上传永久性图文素材
     */
    public String uploadImgToGzh(String appid, String imgUrl, MultipartFile file, WxMpService wxService);

    /**
     * 上传永久性素材
     */
    public String uploadFileToGzh(String appid, String imgUrl, MultipartFile file, String type, WxMpService wxService);

    /**
     * 生成二维码
     */
    public String qrCodeCreateTmpTicket(JSONObject jsonReq, String appid, WxMpService wxService);

    /**
     * 客服消息
     */
    public void sendKefuMessage(JSONObject map, String appid, WxMpService wxService);

    /**
     * 模板消息
     */
    public void sendTemplateMessage(JSONObject jsonObject, String appid, WxMpService wxService) throws Exception;

    /**
     * 用户基本信息
     */
    public boolean getUserInfo(String openid, String appid, WxMpService wxService);

    /**
     * 自定义菜单
     */
    public String menuCreate(String json, String appid, WxMpService wxService) throws Exception;

    /**
     * 获取openid
     */
    public String getOpenid(String appId, String secret, String code, WxMpService wxService) throws Exception;

    /**
     * 自动回复
     */
    public void autoReply(String characterEncoding, String msgStr, HttpServletResponse response) throws IOException;

    /**
     * 获取素材列表
     */
    public WxMpMaterialFileBatchGetResult getMaterialList(String appid, String type, Integer begin, Integer end, WxMpService wxService) throws WxErrorException;

    /**
     * 删除素材
     */
    public boolean deleteMaterial(String appid, String mediaId, WxMpService wxService) throws WxErrorException;

    /**
     * 获取图文素材列表
     */
    public WxMpMaterialNewsBatchGetResult getNewsMaterialList(String appid, Integer offset, Integer count, WxMpService wxService) throws WxErrorException;
}
